<?php
namespace app\shop\controller;
use think\Controller;

class Index extends Controller
{
    protected $ProductModel = null;

    public function __construct()
    {
        parent::__construct();

        $this->ProductModel = model('product.Product');
    }

    public function home()
    {
        $hotList = $this->ProductModel->where(['flag' => '2','status' => '1'])->limit(6)->order('createtime desc')->select();
        $recommendList  =$this->ProductModel->where(['flag' => '3','status' => '1'])->limit(6)->order('createtime desc')->select();

        $data = [
            'hotList' => $hotList,
            'recommendList' => $recommendList
        ];

        $this->success('查询数据成功',null,$data);
    }
}
